home *** CD-ROM | disk | FTP | other *** search
- ** Last revision: April 6, 1986 at 15:54
- * postit.acc - module to update the file
- STOR .f. TO ok
- CLEA
- STOR 'Y' to comm
- @ 10,00 SAY 'Do you want to post the tenant rent payments to the tenant accounts ?'
- @ 10,70 GET comm PICTURE '!'
- READ
- DO WHIL AT(comm,'YN') = 0
- @ 10,70 GET comm PICTURE '!'
- READ
- ENDD
- IF comm = 'Y'
- STOR .t. TO accrue1
- ELSE
- STOR .f. TO accrue1
- ENDI
- STOR 'Y' TO comm1
- @ 12,10 SAY 'Do you want to post the monthly rent accruals ?'
- @ 12,59 GET comm1 PICTURE '!'
- READ
- DO WHIL AT(comm1,'YN') = 0
- @ 12,59 GET comm1 PICTURE '!'
- READ
- ENDD
- IF comm1 = 'Y'
- STOR DTOC(date()) to mdate1
- @ 14,10 SAY 'What is the rent accrual date (MM/DD/YY) ? '
- @ 14,59 GET mdate1 PICTURE '99/99/99'
- READ
- STOR .t. TO accrue
- ELSE
- STOR .f. TO accrue
- ENDI comm1
- IF accrue1
- CLOS INDEX
- GO TOP
- STOR 0 TO latech
- STOR .t. TO yes
- STOR .f. TO no
- LOCA for SUBSTR(data,7,3) = '104' .AND. SUBSTR(data,12,1) = 'T' .AND.(.NOT. posted)
- DO WHIL accrue1
- STOR RECNO() TO rec_no
- STOR SUBSTR(data,13,5) TO name
- STOR SUBSTR(date,5,2) TO mlate
- STOR (amount*-1) to mamount
- STOR SUBSTR(date,3,2)+'/'+SUBSTR(date,5,2)+'/'+SUBSTR(date,1,2) TO date1
- SELE B
- USE &dr.:tenant
- SET index to &dr.:codea
- SEEK name
- IF .NOT. (EOF() .OR. BOF())
- STOR trentd TO mtrentd
- STOR trentt TO mtrentt
- STOR trenty TO mtrenty
- STOR tlatec TO mlatec
- IF VAL(mlate) > VAL(tlate)
- STOR latech + mlatec TO latech
- STOR latech + mtrentd TO mtrentd
- REPL watchit WITH yes
- ENDI VAL(mlate)
- REPL trentd WITH (mtrentd-mamount),trentp WITH mamount
- REPL trentt WITH (mtrentt+mamount), trenty WITH (mtrenty+mamount)
- REPL trentpd WITH date1, tupdate WITH DTOC(date()), posted WITH yes
- STOR .t. TO ok
- ELSE
- STOR .f. TO ok
- ENDI # <) 0
- SELE C
- USE &dr.:account
- * SET INDEX TO &dr.:account
- GO rec_no
- IF ok
- REPL posted WITH yes
- ENDI ok
- CONT
- IF EOF()
- STOR .f. TO accrue1
- ENDI EOF
- ENDD WHILE accrue1
- IF latech > 0
- CLOS INDEX
- GO BOTTOM
- STOR .f. TO firstup
- DO WHIL .NOT. firstup
- IF SUBSTR(data,1,1) = 'J'
- STOR VAL(SUBSTR(data,2,3)) TO entryno
- STOR .t. TO firstup
- ELSE
- SKIP -1
- ENDI
- ENDD WHILE .NOT. firstup
- SET INDEX TO &dr.:account
- STOR entryno + 1 TO entryno
- STOR entryno + 1000 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH DTOC(date())
- REPL data with entry + '993020C'+'acc late chgs - all ' + DTOC(date())+'J'
- REPL amount WITH (latech*-1)
- APPE BLANK
- REPL date WITH DTOC(date())
- REPL data with entry + '991040D'+'acc late chgs - all ' + DTOC(date())+'J'
- REPL amount WITH latech
- ENDI latech
- * RELE latech, firstup, entryno, entry, rec_no, accrue1, ok, comm
- * RELE name, mlate, mamoubt, mtrentd, mtrentt, mtrenty, mtlatec
- ENDI accrue1
- IF accrue
- SELE B
- USE &dr.:TENANT
- * if more than 10 properties, will have to adjust this
- STOR 0 TO rent01
- STOR 0 TO rent02
- STOR 0 TO rent03
- STOR 0 TO rent04
- STOR 0 TO rent05
- STOR 0 TO rent06
- STOR 0 TO rent07
- STOR 0 TO rent08
- STOR 0 TO rent09
- STOR 0 TO rent10
- STOR .t. TO yes
- STOR .f. TO no
- GO TOP
- DO WHIL .NOT. EOF()
- IF SUBSTR(bcode,1,2) = '01'
- STOR rent01 + (trent +trente+trentm+ taddl) TO rent01
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '01'
- IF SUBSTR(bcode,1,2) = '02'
- STOR rent02 + (trent + trente+ trentm+ taddl) TO rent02
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '02'
- IF SUBSTR(bcode,1,2) = '03'
- STOR rent03 + (trent +trente+trentm+ taddl) TO rent03
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '03'
- IF SUBSTR(bcode,1,2) = '04'
- STOR rent04 + (trent +trente+trentm+ taddl) TO rent04
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '04'
- IF SUBSTR(bcode,1,2) = '05'
- STOR rent05 + (trent +trente+trentm+ taddl) TO rent05
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '05'
- IF SUBSTR(bcode,1,2) = '06'
- STOR rent06 + (trent +trente+trentm+ taddl) TO rent06
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '06'
- IF SUBSTR(bcode,1,2) = '07'
- STOR rent07 + (trent +trente+trentm+ taddl) TO rent07
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '07'
- IF SUBSTR(bcode,1,2) = '08'
- STOR rent08 + (trent +trente+trentm+ taddl) TO rent08
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '08'
- IF SUBSTR(bcode,1,2) = '09'
- STOR rent09 + (trent +trente+trentm+ taddl) TO rent09
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '09'
- IF SUBSTR(bcode,1,2) = '10'
- STOR rent10 + (trent +trente+trentm+ taddl) TO rent10
- REPL trentd WITH (trentd + trent + trente +trentm + taddl)
- REPL tupdate WITH DTOC(DATE()), posted WITH no
- ENDI $(bcode,1,2) = '10'
- SKIP
- ENDD WHILE .NOT. eof
- SELE B
- USE &dr.:ACCOUNT
- CLOS INDEX
- GO BOTTOM
- IF (EOF() .OR. BOF())
- STOR 0 TO entryno
- STOR .t. TO firstup
- ELSE
- STOR .f. TO firstup
- ENDI
- DO WHIL .NOT. firstup
- IF SUBSTR(data,1,1) = 'J'
- STOR VAL(SUBSTR(data,2,3)) TO entryno
- STOR .t. TO firstup
- ELSE
- SKIP -1
- ENDI
- ENDD WHILE .NOT. firstup
- STOR SUBSTR(mdate1,7,2) + SUBSTR(mdate1,1,2) + SUBSTR(mdate1,4,2) TO mdat1
- IF rent01 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1000 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'013020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent01*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'011040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent01
- ENDI rent01 > 0
- IF rent02 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'023020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent02*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'021040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent02
- ENDI rent02 > 0
- IF rent03 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'033020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent03*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'031040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent03
- ENDI rent03 > 0
- IF rent04 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'043020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent04*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'041040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent04
- ENDI rent04 > 0
- IF rent05 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'053020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent05*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'051040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent05
- ENDI rent05 > 0
- IF rent06 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'063020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent06*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'061040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent06
- ENDI rent06 > 0
- IF rent07 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'073020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent07*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'071040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent07
- ENDI rent07 > 0
- IF rent08 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'083020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent08*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'081040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent08
- ENDI rent08 > 0
- IF rent09 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'093020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent09*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'091040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent09
- ENDI rent09 > 0
- IF rent10 > 0
- STOR entryno + 1 TO entryno
- STOR entryno + 1001 TO entryn
- STOR STR(entryn,4) to entry
- STOR 'J' + SUBSTR(entry,2,3) TO entry
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'103020C'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH (rent10*-1)
- APPE BLANK
- REPL date WITH mdat1
- REPL data WITH entry+'101040D'+'rent accrual '+DTOC(date())+'J'
- REPL amount WITH rent10
- ENDI rent10 > 0
- ENDI accrue
- SELE B
- USE &dr.:account
- SET INDEX TO account
- STOR 'Y' TO command
- CLEA
- TEXT
-
- This module updates the accounting files so that statements
- can be prepared. The way to do is are to reindex the
- file - and then to set the accrual and statement dates.
-
- If all you want to do is update the rental records to send
- out monthly rent bills - you need not reindex. You also do
- not have to reindex if no entries were made since your last
- reindexing.
-
- SHALL WE REINDEX ?
-
-
-
-
-
-
-
-
-
-
- ENDT
- @ 11,43 GET command PICTURE '!'
- READ
- IF command = 'Y'
- @ 14,15 SAY 'Reindexing............please be patient'
- @ 15,15 SAY '......................but I will keep you posted'
- @ 16,00
- SET TALK ON
- SET ECHO ON
- INDE ON date + SUBSTR(data,7,4) + SUBSTR(data,5,1) TO &dr.:account
- SET TALK OFF
- SET ECHO OFF
- ENDI command = 'Y'
- SET INDEX TO &dr.:account
- CLEA
- RETU